package com.sch.wanandroid.ui.splash

import android.os.Bundle
import androidx.lifecycle.lifecycleScope
import com.sch.wanandroid.R
import com.sch.wanandroid.base.BaseActivity
import com.sch.wanandroid.ui.main.MainActivity
import kotlinx.coroutines.*

/**
 * 欢迎
 */
class SplashActivity : BaseActivity() {

    override fun getLayoutId(): Int {
        return R.layout.activity_splash
    }

    override fun init(savedInstanceState: Bundle?) {
        lifecycleScope.launch {
            withContext(Dispatchers.Default) {
                delay(2000)
            }
            intent(MainActivity::class.java, false)
            finish()
        }
    }
}